{include file='common/_meta' /}
<body>
<div class="container">

    <button class="layui-btn" id="allCaches" style="margin: 20px;">清除全部缓存</button>

</div>
{include file="common/_footer"}

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
layui.use('form', function() {

    var layer = layui.layer;
    var form  = layui.form;

    $('#allCaches').on('click', function(event) {
        event.preventDefault();
        
        layer.confirm('清除全部缓存？', function(index) {

            layer.close(index);

              $.ajax({
                  type: 'POST',
                  url: '{:url('Caches/clear')}',
                  success: function(json) {

                      if (json.code == 200) {

                            layer.msg(json.msg, {icon: 1, time:1000});
                      } else {

                            layer.msg(json.msg, {icon: 2, time:1000});
                            return false;
                        }
                  },
                  error:function(data) {

                      layer.msg('清除错误!', {icon: 2, time:1000});
                  },
              });
        });
    });

});
</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>